<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>Title</title>
    <link rel="stylesheet" href="../layui/css/layui.css">
    <link rel="stylesheet" href="../font-awesome-4.7.0/css/font-awesome.min.css">
    <script>

    </script>
</head>
<body>
<h2>用户管理</h2>
<div id="toolbar" style="display: flex">
    <button class="layui-btn" onclick="showAddModel()"><i class="fa fa-plus"></i> 添加</button>
    <button class="layui-btn layui-bg-red" onclick="deleteUser()"><i class="fa fa-minus"></i> 删除</button>
    <button class="layui-btn layui-bg-cyan" onclick="editUser()"><i class="fa fa-edit"></i> 编辑</button>

    <input type="text" name="searchUserName" placeholder="请输入用户名" autocomplete="off" class="layui-input"
           style="margin-left: 40px;width: 400px;margin-right: 0px">

    <button class="layui-btn" onclick="searchUser()"><i class="fa fa-search"></i></button>

</div>

</div>
<div id="editUserModel" style="padding: 10px;display: none">
    <form id="editUserForm" class="layui-form layui-form-pane">
        <input type="hidden" name="userId"/>
        <div class="layui-form-item" pane>
            <label class="layui-form-label">用户名</label>
            <div class="layui-input-block">
                <input type="text" name="userName" required lay-verify="checkUserName" placeholder="请输入用户名"
                       autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item" pane>
            <label class="layui-form-label">密码</label>
            <div class="layui-input-block">
                <input type="password" name="userPwd" required lay-verify="checkPassword" placeholder="请输入密码"
                       autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item" align="center">
            <button class="layui-btn" lay-submit lay-filter="updateUserBtn">立即提交</button>
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>

    </form>
</div>

<div id="addUserModel" style="padding: 10px;display: none">
    <form id="addUserForm" class="layui-form layui-form-pane">
        <div class="layui-form-item" pane>
            <label class="layui-form-label">用户名</label>
            <div class="layui-input-block">
                <input type="text" name="userName" required lay-verify="checkUserName" placeholder="请输入用户名"
                       autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item" pane>
            <label class="layui-form-label">密码</label>
            <div class="layui-input-block">
                <input type="password" name="userPwd" required lay-verify="checkPassword" placeholder="请输入密码"
                       autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item" align="center">
            <button class="layui-btn" lay-submit lay-filter="addUserBtn">立即提交</button>
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>

    </form>
</div>
<table id="user-table" lay-filter="test"></table>
<script src="../layui/layui.all.js"></script>
<script src="../js/userManager.js"></script>
</body>
</html>